class Person:
    def __init__(self,name,age,gender):
        self.name=name
        self.age=age
        self.gender=gender
    

    def introduce(self):
        return f"大家好，我叫{self.name},今年{self.age}岁，性别{self.gender}."
    

class Student(Person):
    def __init__(self,name,age,gender,student_id,grade):
        super().__init__(name,age,gender)
        self.student_id=student_id
        self.grade=grade
        self.courses=[]

    def introduce(self):
        return f"大家好，我叫{self.name}，性别{self.grade}，是{self.grade}年级的学生，学号是{self.student_id}。"
    

    def enroll_course(self,course):
        if course not in self.courses:
            self.courses.append(course)
            course.add_student(self)
            return f"{self.name}成功选修了{course.name}课程。"
        return f"{self.name}已经选修了{course.name}课程。"
    
    def list_courses(self):
        if self.courses:
            course_names=[course.name for course in self.courses]
            return f"{self.name}选修的课程有{','.join(course_names)}"
        return f"{self.name}还没有选修任何课程"



class Administrator(Person):
    def __init__(self,name,age,gender,admin_id):
        super().__init__(name,age,gender)
        self.admin_id=admin_id

    
class Grade:
    def __init__(self,grade):
        self.grade=grade
        self.courses=[]
        